Add test MT.1106 to verify Protected Actions Auth Contexts have CA policies#1356
Add test MT.1106 to verify Protected Actions Auth Contexts have CA policies#1356
Conversation
…ons Auth Context validation Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new validation test to ensure that protected actions using Authentication Contexts are actually enforced by Conditional Access policies, plus associated documentation and baseline test wiring.
- Introduces Test-MtCaAuthContextProtectedActionsExist to detect Authentication Contexts used by Protected Actions but not referenced by any CA policy.
- Wires the test into the Conditional Access baseline suite (MT.1090).
- Adds user-facing documentation for the test and website page.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| website/docs/tests/maester/MT.1090.md | New website doc explaining MT.1090 test purpose, remediation steps, and links. |
| tests/Maester/Entra/Test-ConditionalAccessBaseline.Tests.ps1 | Adds the MT.1090 test case to the Entra Conditional Access baseline suite. |
| powershell/public/maester/entra/Test-MtCaAuthContextProtectedActionsExist.ps1 | Implements the test logic to correlate protected actions’ Authentication Contexts with CA policies. |
| powershell/public/maester/entra/Test-MtCaAuthContextProtectedActionsExist.md | Adds command documentation with remediation steps and related links. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
powershell/public/maester/entra/Test-MtCaAuthContextProtectedActionsExist.ps1
Outdated
Show resolved
Hide resolved
powershell/public/maester/entra/Test-MtCaAuthContextProtectedActionsExist.ps1
Outdated
Show resolved
Hide resolved
powershell/public/maester/entra/Test-MtCaAuthContextProtectedActionsExist.ps1
Outdated
Show resolved
Hide resolved
powershell/public/maester/entra/Test-MtCaAuthContextProtectedActionsExist.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
SamErde
left a comment
There was a problem hiding this comment.
The test ID 'MT.1090' is already taken. 'MT.1106' should be used for this test. References within this PR need to be changed accordingly.
…s, check isEnabled for rules, detect deleted contexts Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Renamed to MT.1106 in commit 550d061. Updated the website doc, test file reference, title, and slug accordingly. |
|
@copilot, all new public functions must be added to the |
…tionsToExport Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Added |
SamErde
left a comment
There was a problem hiding this comment.
Ready for other peer review and testing.
|
@copilot, this test reports a This is not accurately checking configuration. I have 5 protected actions that have authentication contexts assigned to them. |
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
I've added verbose logging in commit 30abcb0 to help diagnose the issue. Could you run the test with Test-MtCaAuthContextProtectedActionsExist -VerboseThe verbose output will show:
This will help identify if the issue is with:
Please share the verbose output so I can adjust the logic accordingly. |
|
…nagement/directory/resourceNamespaces) Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Fixed in commit ffd203d. The issue was using the wrong API endpoint. Protected Actions are accessed through The updated code now:
Please test again with |
|
… property names Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
I've added enhanced verbose logging in commit 1049fa3 to show the actual structure of resource actions. Please run with Test-MtCaAuthContextProtectedActionsExist -VerboseThe new logging will show:
This will help identify the correct property name for the authentication context ID. The screenshot shows "c4" as the auth context ID, so we need to find which property contains that value. |
|
The verbose output shows that the This indicates that authentication context assignments for Protected Actions are stored separately, not as a property on the resource action itself. Based on the Microsoft Graph API structure, Protected Actions with authentication contexts may need to be queried through a different endpoint or via authentication context settings. Let me investigate the correct API approach. The screenshot shows "c4" as the auth context ID, but it's not appearing in the |
Test-MtCaAuthContextProtectedActionsExist.ps1.mdfile)Test-ConditionalAccessBaseline.Tests.ps1isEnabledflag for authentication context rules$authContextsInProtectedActionsto detect deleted contexts💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.